<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Tải miễn phí game <?php echo Common::removeSign($game["title"]);?></title>
<style>
    body {
    margin: 0;
    padding: 0px;
    font-family: Arial;
    font-size: normal;
    color: #4F4C47;
    background: #F8F8F8;
    }
    a {
    color: #CC0000;
    text-decoration: none;
    font-size: normal;
    }
    a:hover {
    color: #006600;
    text-decoration: none;
    font-size: normal;
    }
    img {
    border: 0px;
    }
    div {
    display: block;
    }
    .head_dlpage {
    padding: 1px;
    background: #444;
    color: #fff;
    text-align: center;
    }
    .head_item {
    color: #666;
    font-size: small;
    padding: 1px 0px 1px 0px
    }
    .list_item {
    padding: 1px 0px 1px 1px;
    border-bottom: 1px solid #E9E9E9
    }
    .end_row {
    padding: 1px;
    }
    .footer_info {
    background: none repeat scroll 0 0 #666666;
    color: #FFFFFF;
    font-size: small;
    padding: 1px;
    text-align: center;
    }
    .dl_header {
    padding: 1px;
    }
    .in_sizebox {
    border: 1px solid #E4E4E4;
    background: #fff;
    padding: 1px 1px 1px 1px;
    margin-top: 1px;
    }
    .item_size {
    color: #F93;
    font-size: small;
    }
    .li_cauhinh {
    padding: 1px;
    }
    .nav_link {
    color: #fff;
    font-weight: bold;
    }
    .nav_link:hover {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    }
    .group_app {
    padding: 1px 1px 1px 1px;
    background: #999;
    color: #fff;
    font-weight: bold;
    }
    .ads_link
    {
    color:#0F0;
    }
    .ads_link:hover
    {
    color:#0F0;
    text-decoration: none;
    }
    .mbox_link {
    color: orange;
    font-weight: bold;
    }
</style>
</head>
<?php
    /*$userId = 0; 
    if(isset($_SESSION["userId"]))
    {
      $userId = $_SESSION["userId"];  
    }*/
?>
<body>
<div class="head_dlpage"> <a name="a_top"></a>
    <strong style="font-size: x-large"><?php echo $game["title"];?></strong> <br>
</div>
<div>
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tbody><tr>
    <td style="padding: 1px; border-right: 1px solid #FFF; background: #F90" align="center" width="34%"><a href="#gr_java" class="nav_link">Tải miễn phí</a></td>
    </tr>
    </tbody></table>
</div>

<div>
    <div class="li_cauhinh">
    Bạn vui lòng chọn phiên bản phù hợp theo máy điện thoại của bạn.
    </div>
    <div>
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody><tr>
                    <td style="padding: 1px; border-right: 1px solid #FFF; background: #F90" align="center" width="34%"><a href="#gr_java" class="nav_link">JAVA</a></td>
                    <td style="padding: 1px; border-right: 1px solid #FFF; background: #F90" align="center" width="34%"><a href="#gr_android" class="nav_link">ANDROID</a></td>
                    <td style="padding: 1px; border-right: 1px solid #FFF; background: #F90" align="center" width="34%"><a href="#gr_ios" class="nav_link">IOS</a></td>
                    <td style="padding: 1px; border-right: 1px solid #FFF; background: #F90" align="center" width="34%"><a href="#gr_pc" class="nav_link">PC</a></td>
            </tr>
            </tbody>
            </table>
    </div>
<div>
<?php
    $isJava = 0;
    $isApk = 0;
    $isIpa = 0;
    foreach($file as $row){ 
        if(strcmp("jar",$row["extension"])==0){
            $isJava = 1;
        }
        
        if(strcmp("apk",$row["extension"])==0){
            $isApk = 1;
        }
        
        if(strcmp("ipa",$row["extension"])==0){
            $isIpa = 1;
        }
    }
?>

<?php if($isJava==1){?>
<div class="group_app">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tbody><tr>
    <td><a name="gr_java" class="nav_link">JAVA</a></td>
    <td align="right"><a href="#a_top" class="nav_link">Top</a></td>
    </tr>
    </tbody></table>
</div>

<div class="li_cauhinh">
<?php
    foreach($file as $row){ 
        if(strcmp("jar",$row["extension"])==0){
?>
    <div>
         <div class="head_item">
                <?php echo $row["introtext"]?>
            </div>
          <div class="list_item"> 
            <a href="<?php echo Url::createUrl("fileApp/downloadFile",array("fileId"=>$row["id"],"userId"=>$userId)) ?>"> <?php echo $row["filename"]?> </a>
            <span class="item_size"><?php echo $row["filesize"]?></span>
            | <a href="<?php echo Url::createUrl("fileApp/downloadFile",array("fileId"=>$row["id"],"userId"=>$userId)) ?>"> jad </a>
         </div>
    </div>
<?php
        }
    }                                  
?>
</div>
<?php
}
?>

<?php if($isApk==1){?>
<div class="group_app">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr>
        <td><a name="gr_android" class="nav_link">ANDROID</a></td>
        <td align="right"><a href="#a_top" class="nav_link">Top</a></td>
        </tr>
        </tbody>
    </table>
</div>
<div class="li_cauhinh">
<?php
    foreach($file as $row){ 
        if(strcmp("apk",$row["extension"])==0){
?>
    <div> 
           <div class="head_item">
                <?php echo $row["introtext"]?>
            </div>
            <div class="list_item"> 
            <a href="<?php echo Url::createUrl("fileApp/downloadFile",array("fileId"=>$row["id"],"userId"=>$userId)) ?>"> <?php echo $row["filename"]?> </a>
            <span class="item_size"><?php echo $row["filesize"]?></span>
             </div>
    </div>
<?php
        }
    }                                  
?>
</div>
<?php
}
?>

<?php if($isIpa==1){?>
<div class="group_app">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tbody><tr>
    <td><a name="gr_ios" class="nav_link">IOS</a></td>
    <td align="right"><a href="#a_top" class="nav_link">Top</a></td>
    </tr>
    </tbody></table>
</div>
<div class="head_item">
Tất cả các dòng máy Iphone/Ipad
</div>
<?php
    foreach($file as $row){ 
        if(strcmp("ipa",$row["extension"])==0){
        $url_file = Common::getImageDomain($row["filename"], "user/" . $username . "/app", "", "", 2);  
        $url_file_plist = str_replace(".ipa",".plist",$url_file);
?>
    <div> 
         <div class="head_item">
                <?php echo $row["introtext"]?>
            </div>
        <div class="list_item"> 
        <a href="<?php echo Url::createUrl("fileApp/downloadFile",array("fileId"=>$row["id"],"userId"=>$userId)) ?>"> <?php echo $row["filename"]?> </a>
        <span class="item_size"><?php echo $row["filesize"]?></span>
        | <a href="itms-services://?action=download-manifest&amp;url=<?php echo $url_file_plist;?>"> Cài tự động </a>
    </div>
    </div>
<?php
        }
    }                                  
?>
</div>
<?php
}
?>


<div class="group_app">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tbody><tr>
    <td><a name="gr_pc" class="nav_link">PC</a></td>
    <td align="right"><a href="#a_top" class="nav_link">Top</a></td>
    </tr>
    </tbody></table>
</div>
<div class="head_item">
Phiên bản cho PC Windows
</div>

<?php
    foreach($file as $row){ 
        if(strcmp("pc",$row["extension"])==0){
?>
    <div> 
         <div class="head_item">
                <?php echo $row["introtext"]?>
            </div>
         <div class="list_item"> 
            <a href="<?php echo Url::createUrl("fileApp/downloadFile",array("fileId"=>$row["id"],"userId"=>$userId)) ?>"> <?php echo $row["filename"]?> </a>
            <span class="item_size"><?php echo $row["filesize"]?></span>
        </div>
    </div>
<?php
        }
    }                                  
?>
</div>

<div class="group_app">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tbody><tr>
    <td><a class="nav_link" name="gr_games">Tải app miễn phí khác</a></td>
    <td align="right"><a class="nav_link" href="#a_top">Top</a></td>
    </tr>
    </tbody></table>
</div>

<div class="list_item"> <a class="mbox_link" href="">Tải app miễn phí khác</a>
</div>
</body>
</html>